#ifndef __MD5_CHECK_H__
#define __MD5_CHECK_H__
#include "BaseType.h"
#include <iostream>

typedef struct {
    uint32  A,B,C,D;	  /* chaining variables */
    uint32  nblocks;
    uint8   buf[64];
    sint32  count;
}MD5_Context_S;

class MD5Check{
public:
    MD5Check();
    ~MD5Check();
    sint32 checkFile(std::string fileName,std::string& md5sum);
    sint32 checkString(std::string srcString,std::string& md5sum);
private:
    void initContext(MD5_Context_S *ctx);
    void transform( MD5_Context_S* ctx, uint8* data);
    void md5Write(MD5_Context_S *hd, uint8* inbuf, sint32 inlen);
    void md5Final(MD5_Context_S *hd);
};

#endif